package com.study.demo.config;

import com.study.demo.model.User;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
public class UserConfig {

    //将此返回的值生成一个bean
    @Bean("user1")
    public User user(){

        User user = new User();

        user.setId(1);
        user.setName("111");

        return user;
    }
}
